package com.ruoyi.sys.admin.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 系统管理员对象 tb_admin
 * 
 * @author hyl
 * @date 2025-06-06
 */
public class Admin extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 管理员 */
    @Excel(name = "管理员")
    private Long adminId;

    /** 账号 */
    @Excel(name = "账号")
    private String username;

    /** 密码 */
    @Excel(name = "密码")
    private String password;

    /** 状态 */
    @Excel(name = "状态")
    private String status;

    /** 权限字符 */
    @Excel(name = "权限字符")
    private String role;

    /** 开始时间（用于范围查询） */
    private String beginTime;

    /** 结束时间（用于范围查询） */
    private String endTime;

    public void setAdminId(Long adminId) 
    {
        this.adminId = adminId;
    }

    public Long getAdminId() 
    {
        return adminId;
    }

    public void setUsername(String username) 
    {
        this.username = username;
    }

    public String getUsername() 
    {
        return username;
    }

    public void setPassword(String password) 
    {
        this.password = password;
    }

    public String getPassword() 
    {
        return password;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public void setRole(String role)
    {
        this.role = role;
    }

    public String getRole() 
    {
        return role;
    }

    public String getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(String beginTime) {
        this.beginTime = beginTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public boolean isAdmin()
    {
        return isAdmin(this.adminId);
    }

    public static boolean isAdmin(Long adminId)
    {
        return adminId != null && 1L == adminId;
    }



    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("adminId", getAdminId())
            .append("username", getUsername())
            .append("password", getPassword())
            .append("status", getStatus())
            .append("role", getRole())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
